import { defHttp } from '/@/utils/http/axios';

enum Api {
  GetApplyReasonList = '/BestSuperMarket/getApplyReasonList',
  GetPushGoodPager = '/BestSuperMarket/getPushGoodPager',
  ExportBatchResult = '/BestSuperMarket/exportBatchResult',
  PushGoods = '/BestSuperMarket/pushGoods',
  GetLastBatchResult = '/BestSuperMarket/getLastBatchResult',
}
/// 获取申请原因
export const getApplyReasonList = () => {
  return defHttp.get({ url: Api.GetApplyReasonList });
};

/// 获取待发布商品分页
export interface pageParams {
  pageIndex: number;
  pageSize: number;
}

export const getPushGoodPager = (params: pageParams) => {
  return defHttp.get({ url: Api.GetPushGoodPager, params });
};

/// 导出批次结果
export interface exportParams {
  batchNo: string;
}
export const exportBatchResult = (params: exportParams) => {
  return defHttp.post({ url: Api.ExportBatchResult, params });
};

/// 发布商品
export interface pushParams {
  applyReason: number;
}
export const pushGoods = (params: pushParams) => {
  return defHttp.post({ url: Api.PushGoods, params });
};

/// 获取最近批次发布结果
export const getLastBatchResult = () => {
  return defHttp.get({ url: Api.GetLastBatchResult });
};
